package com.woniuxy.commons.service;

import com.woniuxy.commons.entity.Goods;
import com.woniuxy.commons.service.factory.ProviderServiceFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

/**
 * @Author: yangtao
 * @date 2021/8/3 11:44
 * @Version 1.0
 */
@FeignClient(name="PROVIDER",fallbackFactory = ProviderServiceFactory.class)
public interface ProviderService {

    @GetMapping("/goods/all")
    public List<Goods> all() throws InterruptedException ;
    @GetMapping("/goods/find/{id}")
    public Goods  findById(@PathVariable("id") int id);

    @PostMapping("/goods/add")
    public boolean add(@RequestBody Goods goods);

    @PutMapping("/goods/update")
    public boolean update(@RequestBody Goods goods);

    @DeleteMapping("/goods/del/{id}")
    public void del(@PathVariable("id") int id);
}
